import request from '@/utils/request';
import type { TableListParams, TableListItem } from './data.d';
export async function queryStatisticsList() {
  return request('/fsd/admin/statistics/perpetualContract', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json;charset=utf-8',
      'token':`${localStorage.getItem('token')}`
    },
    // params:{
    //   token:
    // },
  });
}
// export async function queryRule(params?: TableListParams) {
//   return request('/btc/order/list', {
//     method: 'POST',
//     headers: {
//       'Content-Type': 'application/json;charset=utf-8',
//     },
//     // params,
//   });
// }
// export async function queryRule(params?: TableListParams) {
//   return request('/fss/Fund2PlanStock/DateList', {
//     method: 'GET',
//     headers: {
//       'Content-Type': 'application/json;charset=utf-8',
//     },
//   });
// }
//
export async function queryRule(params?: TableListParams) {
  return request('/api/rule', {
    params,
  });
}

export async function removeRule(params: { key: number[] }) {
  return request('/api/rule', {
    method: 'POST',
    data: {
      ...params,
      method: 'delete',
    },
  });
}

export async function addRule(params: TableListItem) {
  return request('/api/rule', {
    method: 'POST',
    data: {
      ...params,
      method: 'post',
    },
  });
}

export async function updateRule(params: TableListParams) {
  return request('/api/rule', {
    method: 'POST',
    data: {
      ...params,
      method: 'update',
    },
  });
}
